﻿<!-- Phan khai bao bien cuc bo-->
<?php
// Luu dieu kien loc hien thoi
if ($v_id >0) {
	$v_name = _replace_bad_char($arr_single[0]['0']);
	$v_code = _replace_bad_char($arr_single[0]['1']);	
	$v_note = _replace_bad_char($arr_single[0]['2']);	
	$v_file_name =_replace_bad_char($arr_single[0]['3']);	
	$v_order = $arr_single[0]['4'];
	$v_status =$arr_single[0]['5'];
	$v_recordtype = $arr_single[0]['6'];
	$v_save_and_add_new=0;
} else {
	$v_id = 0;
	$v_code = "";
	$v_name = "";
	$v_note = "";
	$v_file_name = "";
	$v_order = _get_next_value("T_ONEGATE_REPORT_TYPE","C_ORDER","");
	$v_status =1;
	$v_recordtype ="";
	$v_save_and_add_new=1;
}
$v_enable = "";
$v_readonly = "";
$v_str_save_and_add_new_checked="";
if ($v_save_and_add_new==1){
	$v_str_save_and_add_new_checked="checked";
}
if(isset($_REQUEST['hdn_filter'])){
	$v_filter = $_REQUEST['hdn_filter'];
}else{	
	$v_filter = "";
}
$v_str_checked="";
if ($v_status==1){
	$v_str_checked="checked";
}?>
<!--bang chua tieu de cua form-->
<table width="100%" cellpadding="0" cellspacing="0">
	<tr class="large_title">
		<td><?php echo CONST_REPORT_TYPE_UPDATE_TITLE; ?></td>
	</tr>
</table>
<!-- Bat cac phim: F12=true; Insert=false; Delete=false, ESC=true; Enter=true -->
<div id="hotkey" onKeyDown="javascript:process_hot_key(true,false,false,true,true);">
<!--bang chua cac text box de nhap du lieu-->
<table width="100%" class="form_table1">
	<col width="20%"><col width="60%"><col width="20%">
	<tr>
		<form action="index.php" method="post" name="f_dsp_single_status" enctype="multipart/form-data">
		<input type="hidden" name="fuseaction" value="UPDATE_CATE" >
		<input type="hidden" name="hdn_report_type_id" value="<?php echo $v_id ?>" >
		<input type="hidden" name="hdn_item_id" value="<?php echo $v_id ?>" >
		<input type="hidden" name="hdn_status" value="<?php echo $v_status ?>">
		<input name="hdn_recordtype_id" type="hidden" value="<?php echo $v_recordtype_id; ?>">
		<input name="hdn_recordtype" type="hidden" value="<?php echo $v_recordtype; ?>">
		<input type="hidden" name="hdn_save_and_add_new" value="<?php echo $v_save_and_add_new; ?>"> 
		<input name="hdn_filter" type="hidden" value="<?php echo $v_filter; ?>">
	</tr>
	<tr>
	<tr>
		<td class="normal_label"><?php echo CONST_REPORT_TYPE_CODE_LABEL; ?><small class="normal_starmark">*</small></td>
		<td><input  name="txt_code" type="text" <?php echo $v_readonly; ?> class="normal_textbox" style="width:30%" value="<?php echo $v_code; ?>" maxlength="<?php echo CONST_CODE_MAXLENGTH; ?>" message="<?php echo CONST_CODE_MESSAGE;?>" optional="<?php echo CONST_CODE_OPTIONAL;?>" onKeyDown="change_focus(document.forms(0),this)"></td>
	</tr>
	<tr>
		<td class="normal_label"><?php echo CONST_REPORT_TYPE_NAME_LABEL; ?> <small class="normal_starmark">*</small></td>
		<td><input name="txt_name" type="text" <?php echo $v_readonly; ?> class="normal_textbox" style="width:99%" value="<?php echo $v_name; ?>" maxlength="<?php echo CONST_NAME_MAXLENGTH;?>" message="<?php echo CONST_NAME_MESSAGE;?>" optional="<?php echo CONST_NAME_OPTIONAL;?>" onKeyDown="change_focus(document.forms(0),this)"></td>
	</tr>
	<tr>
		<td class="normal_label"><?php echo CONST_NAME_RECORDTYPE_LABEL;?></td>
		<td>
			<select class="normal_selectbox" name="sel_cate" style="width:99%"  message = "<?php echo CONST_RECORDTYPE_MESSAGE; ?>" optional = "<?php echo CONST_RECORDTYPE_OPTIONAL; ?>" onChange="sel_onclick(this,document.forms(0).hdn_recordtype);">
            <option id="" value="">--<?php echo CONST_RECORDTYPE_SELECT_LABEL;?>--</option>
	        <?php echo _generate_select_option($arr_all_recordtype,'PK_RECORDTYPE','PK_RECORDTYPE','C_NAME', $v_recordtype);?>
          </select>
		</td>
	</tr>
	<tr>
		<td class="normal_label"><?php echo CONST_REPORT_TYPE_NOTE_LABEL; ?></td>
		<td><input name="txt_note" type="text" <?php echo $v_readonly; ?> class="normal_textbox" style="width:99%" value="<?php echo $v_note; ?>" maxlength="<?php echo CONST_NOTE_MAXLENGTH;?>" message="<?php echo CONST_NOTE_MESSAGE;?>" optional="<?php echo CONST_NOTE_OPTIONAL;?>" onKeyDown="change_focus(document.forms(0),this)"></td>
	</tr>
	<tr>
		<td class="normal_label"><?php echo CONST_REPORT_TYPE_FILE_LABEL; ?></td>
		<td><?php echo $v_file_name; ?></td>
	</tr>
	<tr>
		<td class="normal_label"></td>
		<td>
			<!-- <input type="file" name="file_xml" style="width:100%" class="small_textbox"> -->
			<input type="text" name="file_xml" value="<?php echo $v_file_name?>" style="width:85%" class="small_textbox" optional="<?php echo CONST_FILE_OPTIONAL;?>"> 
			<input type="button" name="btn_back" class="small_button" value="<?php echo CONST_BROWSE_FILE_LABEL;?>" onClick="show_all_file_onclick('list/report/index.php','LIST_FILE_XML')" onKeyDown="change_focus(document.forms(0),this)">
		</td>
	</tr>	
	<tr>
		<td class="normal_label"><?php echo _CONST_ORDER_LABEL; ?></td>
		<td><input name="txt_order" type="text" <?php echo $v_readonly; ?> class="short_number_textbox" value="<?php echo $v_order; ?>" maxlength="<?php echo CONST_ORDER_MAXLENGTH;?>" message="<?php echo CONST_ORDER_MESSAGE;?>" optional="<?php echo CONST_ORDER_OPTIONAL;?>" isnumeric="<?php echo CONST_CATE_ORDER_ISNUMERIC; ?>" min="<?php echo CONST_ORDER_MIN; ?>" max="<?php echo CONST_ORDER_MAX; ?>" onKeyDown="change_focus(document.forms(0),this)"></td>
	</tr>
	<tr class="normal_label">
		<td>&nbsp;</td>
		<td><input type="checkbox" name="chk_status" <?php echo $v_enable;?> class="normal_checkbox" <?php echo $v_str_checked;?> onClick="btn_single_checkbox_onclick(document.forms(0).chk_status,document.forms(0).hdn_status)" onKeyDown="change_focus(document.forms(0),this)"> <?php echo _CONST_STATUS_COLUMN_ACTIVE_VALUE;?></td>
	</tr>
	<tr class="normal_label">
		<td height="37"></td>
		<td><input type="checkbox" name="chk_save_and_add_new" <?php echo $v_enable;?> class="normal_checkbox" <?php echo $v_str_save_and_add_new_checked; ?> onclick="btn_single_checkbox_onclick(document.forms(0).chk_save_and_add_new,document.forms(0).hdn_save_and_add_new)" onKeyDown="change_focus(document.forms(0),this)"><?php echo _CONST_SAVE_AND_ADD_NEW_LABEL;?></td>
	</tr>
</table>
<!--bang chua cac button-->
<table width="100%" >
	<tr>
		<td align="center" width="100%" height="40" valign="bottom"><?php
			if ($v_is_granted_update){?>
			<input type="button" name="btn_save"  class="normal_button" value="<?php echo _CONST_SAVE_BUTTON;?>" onClick="btn_save_onclick('UPDATE_REPORT_TYPE')" onKeyDown="change_focus(document.forms(0),this)"><?php
			}?>
			<input type="button" name="btn_back" class="normal_button" value="<?php echo _CONST_BACK_BUTTON;?>" onClick="btn_back_onclick('<?php echo $_GO_BACK?>')" onKeyDown="change_focus(document.forms(0),this)">	
		</td>
	</tr>
</table>					
</div>
</form>

